package com.kompas.bola.application.ui;

import android.content.Context;
import android.util.AttributeSet;
import android.webkit.WebView;

import com.kompas.bola.application.ui.IWebviewPanel;

public class CustomWebviewScroll extends WebView {
	private IWebviewPanel _iWebviewPanel;

	public CustomWebviewScroll(Context paramContext) {
		super(paramContext);
	}

	public CustomWebviewScroll(Context paramContext,
			AttributeSet paramAttributeSet) {
		super(paramContext, paramAttributeSet);
	}

	public IWebviewPanel getIWebviewPanel() {
		return this._iWebviewPanel;
	}

	protected void onScrollChanged(int paramInt1, int paramInt2, int paramInt3,
			int paramInt4) {
		super.onScrollChanged(paramInt1, paramInt2, paramInt3, paramInt4);
		boolean bool = false;
		int i = (int) Math.floor(getContentHeight() * getScale());
		if (getScrollY() + getHeight() < i) {
			if (getScrollY() < 10) {
				bool = true;
			}
		} else {
			bool = true;
		}
		if ((getIWebviewPanel() != null) && (bool))
			getIWebviewPanel().setPanelVisibility(bool);
	}

	public void setIWebviewPanel(IWebviewPanel paramIWebviewPanel) {
		this._iWebviewPanel = paramIWebviewPanel;
	}
}